export let baseUrl="http://localhost:8888"
export let sessionId=''
export let userInfo={}
export let userAuth=''

export function  isEmail(str) {
             var reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
            return  reg.test(str);
         }

export function loginBefore(){
	let user=localStorage.getItem("user")
		if(user==null){
			uni.showToast({
				icon:'error',
				title:'请先登录'
			})
			setTimeout(() => {
				uni.switchTab({
					url: "/pages/home/home"
				})
			}, 500)
		}
}
